package com.wyh.filemanager.model;

import java.io.File;
import java.io.FileFilter;

import com.wyh.filemanager.util.FileUtil;

public class MyFileFilter implements FileFilter {

	private static MyFileFilter mInstance;

	public static MyFileFilter getInstance() {
		if (mInstance == null) {
			mInstance = new MyFileFilter();
		}
		return mInstance;
	}

	private MyFileFilter() {
	}

	@Override
	public boolean accept(File file) {
		if (!FileUtil.isNormalFile(file.getAbsolutePath()))
			return false;
		if (file.isHidden() && !SettingUtil.getInstanse().isShowHiddenFile())
			return false;
		return true;
	}

}
